var builder = WebApplication.CreateBuilder(args);

builder.Inject();

builder.Host.UseSerilog();

// Add services to the container.

builder.Services.AddControllers()
    .AddDynamicApiControllers()
    .AddInject();

builder.Services.AddDatabaseAccessor(options =>
{
    options.AddDbPool<EsDbContext>();
});

var app = builder.Build();

// Configure the HTTP request pipeline.

app.UseRouting();

app.UseAuthorization();

app.UseInject(string.Empty);

app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
});

//app.MapControllers();

app.Run();
